[tool.poetry]
name = "tracker"
version = "0.1.0"
description = ""
authors = ["Yaroslav <yarikbritov@yandex.ru>", "suredrope"]
license = "MIT"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
asyncpg = "^0.29.0"
psycopg2-binary = "^2.9.9"
sqlalchemy = { extras = ["asyncio"], version = "^2.0.25" }
alembic = "^1.13.1"
pyjwt = {extras = ["crypto"], version = "^2.8.0"}
bcrypt = "^4.1.2"
python-multipart = "^0.0.6"
fastapi = {extras = ["all"], version = "^0.109.0"}
uvicorn = "^0.27.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.4"
httpx = "^0.26.0"
black = "^23.12.1"
mypy = "^1.8.0"
pylint = "^3.0.3"
poethepoet = { extras = ["poetry-plugin"], version = "^0.24.4" }
coverage = { extras = ["toml"], version = "^7.4.0" }
pylint-pydantic = "^0.3.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.coverage.report]
fail_under = 80

[tool.pylint]
disable = ["C0114, C0115, C0116, R0903, W0613"]
load-plugins = "pylint_pydantic"


[tool.mypy]
warn_no_return = false
disable_error_code = ["arg-type"]


[tool.poe.tasks.fmt]
help = "Format code using black & isort."
shell = '''
        isort src/
        black src/
        '''

[tool.poe.tasks.lint]
help = "Run pylint, black, mypy linters"
shell = '''
        mypy --ignore-missing-imports src/
        pylint src/
        black --check src/
        '''

[tool.poe.tasks.test]
help = "Run pytest and coverage report"
shell = '''
        coverage run -m pytest && coverage report -m --skip-covered --skip-empty
        '''

[tool.poe.tasks.up_db]
help = ""
shell = '''
        docker compose -f docker-compose-local.yaml up -d
        '''

[tool.poe.tasks.down_db]
help = ""
shell = '''
        docker compose -f docker-compose-local.yaml down --remove-orphans && docker network prune --force
        '''
